package com.hdu.point_offer;

public class lcr163 {
    class Solution {
        public int findKthNumber(int k) {
            int bit = 1;
            long count = 9;
            long start = 1;
            while (count < k) {
                k -= count;
                bit++;
                start *= 10;
                count = 9 * start * bit;
            }
            long num = start + (k - 1) / bit;
            return Long.toString(num).charAt((k - 1) % bit) - '0';
        }
    }
}
